package tech.aistar.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import tech.aistar.dao.ICartDao;
import tech.aistar.model.pojo.Cart;

import java.util.List;

@Controller
public class CartController {

    @Autowired
    private ICartDao cartDao;
    @GetMapping("/product/cart")
    public String index(Model model) {
        List<Cart> cartList = cartDao.findAll();
        model.addAttribute("cartList",cartList);
        return "cart";
    }
}
